<%@ page language="java"  pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@ include file="/includes/main.jsp"%>
<script type="text/javascript">
function processArea(){
    document.getElementById("f_area").value = $("#areaId").val();
    document.getElementById("country_name").value="";
 }
</script>
<h2 class="contentTitle"><hi:text key="编辑页面" parameterLanguageKeys="旅游线路"/></h2>
<form action="tripModelSave.action?navTabId=tripModelList&callbackType=closeCurrent&ajax=1" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)">
<div class="pageContent">
	<div class="pageFormContent" layoutH="97">
		<dl>
			<dt><hi:text key="线路名称" entity="TripModel"/>：</dt><dd><input type="text" name="tripModel.trip_name" class="textInput required" value="${tripModel.trip_name}" maxlength="40"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="线路编号" entity="TripModel"/>：</dt><dd><input type="text" name="tripModel.trip_code" class="textInput required tripcode" value="${tripModel.trip_code}" alt="<hi:text key="请输入整数"/>"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="参考价格" entity="TripModel"/>：</dt><dd><input type="text" name="tripModel.price" class="textInput required float" min="0.0"  value="${tripModel.price}" alt="<hi:text key="请输浮点数"/>"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="旅行天数" entity="TripModel"/>：</dt><dd><input type="text" name="tripModel.days" class="textInput required integer" min="1" value="${tripModel.days}" alt="<hi:text key="请输入整数"/>"/></dd>
		</dl>
				<dl>
			<dt><hi:text key="地区" entity="TripModel"/>：</dt><dd><hi:select emu="area" name="tripModel.trip_area" id="areaId" isNull="true" onchange="processArea(this)"/></dd>			
		</dl>
		<dl>
			<dt><hi:text key="国家" entity="TripModel"/>：</dt>
			<dd>
				<input type="hidden" name="tripModel.country.id" value="${tripModel.country.id}"/>
				<input type="hidden" lookupGroup="tripModel" lookupName="country" name="pageInfo.f_area" id="f_area" value=""/>
				<input type="text" class="textInput" name="tripModel.hi_country.country_name" value="${tripModel.country.country_name}"
					autocomplete="off" lookupGroup="tripModel" lookupName="country" suggestClass="org.hi.base.model.Country" searchFields="country_name"/>
				<a class="btnLook" href="<hi:url>countryLookup.action?lookup=1</hi:url>" lookupGroup="tripModel" lookupName="country"><hi:text key="查找带回"/></a>		
			</dd>
		</dl>
		<dl>
			<dt><hi:text key="旅行主题" entity="TripModel"/>：</dt>
			<dd>
				<input type="hidden" name="tripModel.theme.id" value="${tripModel.theme.id}"/>
				<input type="text" class="textInput" name="tripModel.hi_theme.title" value="${tripModel.theme.title}"
					autocomplete="off" lookupGroup="tripModel" lookupName="theme" suggestClass="org.hi.tripmodel.model.TripTheme" searchFields="title"/>
				<a class="btnLook" href="<hi:url>tripThemeLookup.action?lookup=1</hi:url>" lookupGroup="tripModel" lookupName="theme"><hi:text key="查找带回"/></a>		
			</dd>
		</dl>
		<dl style="height:auto; width: auto;">
			<dt><hi:text key="适宜月份" entity="TripModel"/>：</dt>
			<dd style="width: auto">
				<hi:select emu="month" name="tripModel.fav_months" type="checkbox" multiple="true" value="${tripModel.fav_months}" />
			</dd>
		</dl>
		<dl>
			<dt><hi:text key="是否推荐到首页" entity="TripModel"/>：</dt><dd><hi:select emu="yesNo" name="tripModel.recommended"/></dd>			
		</dl>
		<dl>
			<dt><hi:text key="是否激活" entity="TripModel"/>：</dt><dd><hi:select emu="yesNo" name="tripModel.enabled"/></dd>			
		</dl>
		<dl>
			<dt><hi:text key="签证说明" entity="TripModel"/>：</dt><dd><input type="text" name="tripModel.visa" class="textInput" value="${tripModel.visa}" size="110" maxlength="200"/></dd>
		</dl>
		<dl  class="nowrap">
			<dt><hi:text key="友情提示" entity="TripModel"/>：</dt>
			<dd>
				<textarea class="editor" name="tripModel.tips" rows="8" cols="95"
					upLinkUrl="xhEditorUpload.action" upLinkExt="zip,rar,txt" 
					upImgUrl="xhEditorUpload.action" upImgExt="jpg,jpeg,gif,png" 
					upFlashUrl="xhEditorUpload.action" upFlashExt="swf"
					upMediaUrl="xhEditorUpload.action" upMediaExt:"avi" html5Upload="false">
				${tripModel.tips}</textarea>
			</dd>
		</dl>
		<dl  class="nowrap">
			<dt><hi:text key="行程亮点" entity="TripModel"/>：</dt>
			<dd>
				<textarea class="editor" name="tripModel.highlights" rows="8" cols="95"
					upLinkUrl="xhEditorUpload.action" upLinkExt="zip,rar,txt" 
					upImgUrl="xhEditorUpload.action" upImgExt="jpg,jpeg,gif,png" 
					upFlashUrl="xhEditorUpload.action" upFlashExt="swf"
					upMediaUrl="xhEditorUpload.action" upMediaExt:"avi" html5Upload="false">
				${tripModel.highlights}</textarea>
			</dd>
		</dl>
		<dl  class="nowrap">
			<dt><hi:text key="付款及取消规则" entity="TripModel"/>：</dt>
			<dd>
				<textarea class="editor" name="tripModel.payment_rules" rows="8" cols="95"
					upLinkUrl="xhEditorUpload.action" upLinkExt="zip,rar,txt" 
					upImgUrl="xhEditorUpload.action" upImgExt="jpg,jpeg,gif,png" 
					upFlashUrl="xhEditorUpload.action" upFlashExt="swf"
					upMediaUrl="xhEditorUpload.action" upMediaExt:"avi" html5Upload="false">
				${tripModel.payment_rules}</textarea>
			</dd>
		</dl>
		<dl  class="nowrap">
			<dt><hi:text key="服务标准" entity="TripModel"/>：</dt>
			<dd>
				<textarea class="editor" name="tripModel.service" rows="8" cols="95"
					upLinkUrl="xhEditorUpload.action" upLinkExt="zip,rar,txt" 
					upImgUrl="xhEditorUpload.action" upImgExt="jpg,jpeg,gif,png" 
					upFlashUrl="xhEditorUpload.action" upFlashExt="swf"
					upMediaUrl="xhEditorUpload.action" upMediaExt:"avi" html5Upload="false">
				${tripModel.service}</textarea>
			</dd>
		</dl>
		<dl  class="nowrap">
			<dt><hi:text key="线路描述" entity="TripModel"/>：</dt>
			<dd>
				<textarea class="editor" name="tripModel.description" rows="8" cols="95"
					upLinkUrl="xhEditorUpload.action" upLinkExt="zip,rar,txt" 
					upImgUrl="xhEditorUpload.action" upImgExt="jpg,jpeg,gif,png" 
					upFlashUrl="xhEditorUpload.action" upFlashExt="swf"
					upMediaUrl="xhEditorUpload.action" upMediaExt:"avi" html5Upload="false">
				${tripModel.description}</textarea>
			</dd>
		</dl>
				<input type="hidden" name="tripModel.id" value="${tripModel.id}"/>
				<input type="hidden" name="tripModel.creator.id" value="${tripModel.creator.id}"/>
				<input type="hidden" name="tripModel.deleted" value="${tripModel.deleted}"/>
				<input type="hidden" name="tripModel.version" value="${tripModel.version}"/>

		<div class="divider"></div>
		
		<div class="tabs">
			<div class="tabsHeader">
				<div class="tabsHeaderContent">
					<ul>
						<li><a href="javascript:void(0)"><span><hi:text key="线路图片"/></span></a></li>
						<li><a href="javascript:void(0)"><span><hi:text key="线路行程"/></span></a></li>
					</ul>
				</div>
			</div>
			<div class="tabsContent" style="height:150px;">
				<div>
					<table class="list nowrap" width="100%" itemDetail="tripModel.tripImages">
						<thead>
							<tr>
								<th type="text" class="" name="title" size="12" maxlength="30"><hi:text key="图片标题" entity="TripImage"/></th>
								<th type="attach" class="required" name="fileName" lookupName="url_attachment" lookupUrl="<hi:url>attachmentLookup.action?lookup=1&from=attachment&saveType=1</hi:url>" size="12"><hi:text key="图片地址" entity="TripImage"/></th>
								<th type="del" width="60"><hi:text key="操作"/></th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="item" items="${tripModel.tripImages}"  varStatus="s">
							<tr>
							<input type="hidden" name="tripModel.tripImages[${s.index}].id" value="${item.id}"/>
							<input type="hidden" name="tripModel.tripImages[${s.index}].version" value="${item.version}"/>
								<td>
									<input type="text" class="" name="tripModel.tripImages[${s.index}].title" value="${item.title}" size="12" maxlength="30"/>
								</td>
								<td>
									<input type="hidden" name="tripModel.tripImages[${s.index}].url_attachment.id" value="${item.url_attachment.id}"/>
									<input type="text" class="required" name="tripModel.tripImages[${s.index}].hi_url_attachment.fileName" value="${item.url_attachment.fileName}" size="12" readonly="readonly"/>
									<a class="btnAttach" href="<hi:url>attachmentLookup.action?lookup=1&from=attachment&saveType=1</hi:url>" lookupGroup="tripModel.tripImages" lookupName="url_attachment" index="${s.index}" width="560" height="300" title="<hi:text key="附件"/>"><hi:text key="附件"/></a>
									<c:if test="${not empty item.url_attachment}">
									<a class="btnView" href="attachmentView.action?attachment.id=${item.url_attachment.id}" target="_blank">
										<hi:text key="查看"/>
									</a>
									</c:if>	
								</td>
								<td><a href="<hi:url>tripImageRemove.action?ajax=1&tripImage.id=${item.id}</hi:url>" class="btnDel" title="<hi:text key="确定要删除吗?"/>">删除</a></td>
							</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>								
				<div>
					<table class="list nowrap" width="100%" itemDetail="tripModel.tripDetails">
						<thead>
							<tr>
								<th type="text" class=" required integer" name="seq" size="12"><hi:text key="顺序" entity="TripDetail"/></th>
								<th type="text" class=" required" name="title" size="12" maxlength="50"><hi:text key="行程标题" entity="TripDetail"/></th>
								<th type="text" class="" name="content" size="120" maxlength="200"><hi:text key="行程内容" entity="TripDetail"/></th>
								<th type="del" width="60"><hi:text key="操作"/></th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="item" items="${tripModel.tripDetails}"  varStatus="s">
							<tr>
							<input type="hidden" name="tripModel.tripDetails[${s.index}].id" value="${item.id}"/>
							<input type="hidden" name="tripModel.tripDetails[${s.index}].version" value="${item.version}"/>
								<td>
									<input type="text" class=" required integer" name="tripModel.tripDetails[${s.index}].seq" value="${item.seq}" size="12" alt="<hi:text key="请输入整数"/>"/>
								</td>
								<td>
									<input type="text" class=" required" name="tripModel.tripDetails[${s.index}].title" value="${item.title}" size="12" maxlength="50"/>
								</td>
								<td>
									<input type="text" class="" name="tripModel.tripDetails[${s.index}].content" value="${item.content}" size="150" maxlength="200"/>
								</td>
								<td><a href="<hi:url>tripDetailRemove.action?ajax=1&tripDetail.id=${item.id}</hi:url>" class="btnDel" title="<hi:text key="确定要删除吗?"/>">删除</a></td>
							</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>								
				
			</div>
			<div class="tabsFooter">
				<div class="tabsFooterContent"></div>
			</div>
		</div>				
	</div>
	<div class="formBar">
		<ul>
			<li><div class="buttonActive"><div class="buttonContent"><button type="submit"><hi:text key="保存"/></button></div></div></li>
			<li><div class="button"><div class="buttonContent"><button class="close" type="button"><hi:text key="关闭"/></button></div></div></li>
		</ul>
	</div>  
</div>
</form>
